package variabilitysmelldetection.measurement.measures.spl;

import java.util.List;

import variabilitysmelldetection.measurement.measures.Measure;
import variabilitysmelldetection.measurement.measures.component.NumberOfAttributes;
import variabilitysmelldetection.measurement.models.ComponentItem;


public class TotalNumberOfAttributes extends Measure {

	
	public TotalNumberOfAttributes() {
		super("Total Number of Attributes", "TNOA");
	}

	@Override
	public void measure(List<ComponentItem> items) {
		int value = 0;
		for (ComponentItem classe : items) {
			Measure m = classe.getMeasure(NumberOfAttributes.class);
			if (m != null) {
				value += m.getValue();
			}
		}
		setValue(value);
	}	
}
